<?php


namespace Yond\LaravelDomain\Console\Domain;


use Illuminate\Support\Str;
use Yond\LaravelDomain\Console\DomainGenerator;

class SeederMakeCommand extends DomainGenerator
{

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'yond:domain:seeder {--model= : The name of model to make seeder}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Make a domain seeder';

    protected function getUserInputs()
    {
        $model = ucfirst($this->optionOrAsk('model', 'Please enter the name of model to make seeder'));

        $table = Str::snake($this->domainName . Str::pluralStudly($model));

        return [
            'path' => [
                'domain' => $this->domainName,
                'model' => $model,
            ],
            'stub' => [
                'domain' => $this->domainName,
                'model' => $model,
                'table' => $table,
            ],
        ];
    }

    protected function getStubName()
    {
        return 'database/seeder.stub';
    }

    protected function getPathStructure()
    {
        return 'domain/{domain}/Database/Seeders/{model}Seeder.php';
    }
}
